<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta charset="utf-8"/>
<title>Sản phẩm</title>
<link rel="stylesheet" href="Css/cc.css"></link>
</head>
<body>
<div class="wrapper">
<?php include 'menu.php';?>
    <div class="content">
<div class="bigleft">
    <div class="bmmenu">
            	<div class="bmenu">
                	<ul>
                                <?php include 'connect.php';
                                    $menu = $con->query("Select * from category");
                                    while ($row = mysqli_fetch_array($menu)) {
                                ?>
                            <li>
                                <div><a href="product.php?dmcha=<?php echo $row['id'];?>"><?php echo $row["name"] ?></a></div>
                                    <ul>
                                        <?php include 'connect.php';
                                    $menu2 = $con->query("Select * from categorydetail where category_id=".$row['id']);
                                    while ($row2 = mysqli_fetch_array($menu2)) {
                                ?>
                                        <div><li><a href="product.php?dmcon=<?php echo $row2['id'];?>"><?php echo $row2["name"] ?></a></li></div>
                                        <?php } ?>
                                    </ul>
                            </li>
                        
                                    <?php } ?>
                    </ul>
                </div>
            </div>
    <?php if(isset($_GET["qa"]))
    {
        $qa = $_GET['qa'];
        $row ="Select * from product where id={$qa}";
        $result = $con->query($row);
        while ($query = mysqli_fetch_array($result))
           {
    ?>
    <div class="bigone">
        <div class="bigimage"><a href=""><img src="<?php echo $query['image']; ?>" /></a></div>
        <div class="smallimage"><a href=""><img src="<?php echo $query['image']; ?>" /></a></div>
    </div>
    <div class="bigtwo">
        <form method="post" action="listcart.php">
                <input type="hidden" name="name" value="<?php echo $query["name"]; ?>">
                <input type="hidden" name="id" value="<?php echo $query["id"]; ?>">
                <input type="hidden" name="price" value="<?php echo $query["price"]; ?>">
                <input type="hidden" name="image" value="<?php echo $query["image"]; ?>">
        <div class="color"><?php echo $query['name']; ?></div>
        <div class="color">Giá: <?php echo $query['price']; ?> VNĐ</div>
        <div class="color">Thông tin: <div style="color: black"><?php echo $query['info']; ?></div> </div>
        <div class="color">Chọn kích cỡ: <select name="product"><option value="M">M</option><option value="L">L</option><option value="X">X</option><option value="XL">XL</option></select></div>
        <div class="color">Số lượng: <input type="text" value="1" name="txtsl"></input></div>
        <div> <input type="submit" value="Mua ngay" class="regis_button" name="now"/></div>
        </form>
    </div>
    <?php }} ?>
    <?php if(isset($_GET["gd"]))
    {
        $gd = $_GET['gd'];
        $row ="Select * from footwear where id={$gd}";
        $result = $con->query($row);
        while ($query = mysqli_fetch_array($result))
           {
    ?>
    <div class="bigone">
        <div class="bigimage"><a href=""><img src="<?php echo $query['image']; ?>" /></a></div>
        <div class="smallimage"><a href=""><img src="<?php echo $query['image']; ?>" /></a></div>
    </div>
    <div class="bigtwo">
        <form method="post" action="listcart.php">
            <input type="hidden" name="name" value="<?php echo $query["name"]; ?>">
                <input type="hidden" name="id" value="<?php echo $query["id"]; ?>">
                <input type="hidden" name="price" value="<?php echo $query["price"]; ?>">
                <input type="hidden" name="image" value="<?php echo $query["image"]; ?>">
        <div class="color"><?php echo $query['name']; ?></div>
        <div class="color">Giá: <?php echo $query['price']; ?> VNĐ</div>
        <div class="color">Thông tin: <div style="color: black"><?php echo $query['info']; ?></div> </div>
        <div class="color">Chọn kích cỡ: <select name="product"><option value="M">M</option><option value="L">L</option><option value="X">X</option><option value="XL">XL</option></select></div>
        <div class="color">Số lượng: <input type="text" value="1" name="txtsl"></input></div>
        <div> <input type="submit" value="Mua ngay" class="regis_button"  name="now" /></div>
        </form>
    </div>
    <?php }} ?>
    <?php if(isset($_GET["index"]))
    {
        $index = $_GET['index'];
        $row ="Select * from product where id={$index}";
        $row2 ="Select * from footwear where id={$index}";
        $result = $con->query($row);
        $result2 = $con->query($row2);
        if ($query = mysqli_fetch_array($result))
           {
    ?>
    <div class="bigone">
        <div class="bigimage"><a href=""><img src="<?php echo $query['image']; ?>" /></a></div>
        <div class="smallimage"><a href=""><img src="<?php echo $query['image']; ?>" /></a></div>
    </div>
    <div class="bigtwo">
        <form method="post" action="listcart.php">
            <input type="hidden" name="name" value="<?php echo $query["name"]; ?>">
                <input type="hidden" name="id" value="<?php echo $query["id"]; ?>">
                <input type="hidden" name="price" value="<?php echo $query["price"]; ?>">
                <input type="hidden" name="image" value="<?php echo $query["image"]; ?>">
        <div class="color"><?php echo $query['name']; ?></div>
        <div class="color">Giá: <?php echo $query['price']; ?> VNĐ</div>
        <div class="color">Thông tin: <div style="color: black"><?php echo $query['info']; ?></div> </div>
        <div class="color">Chọn kích cỡ: <select name="product"><option value="M">M</option><option value="L">L</option><option value="X">X</option><option value="XL">XL</option></select></div>
        <div class="color">Số lượng: <input type="text" value="1" name="txtsl"></input></div>
        <div> <input type="submit" value="Mua ngay" class="regis_button"  name="now" /></div>
        </form>
    </div>
    <?php }
    elseif ($query = mysqli_fetch_array($result2))
           {
    ?>
    <div class="bigone">
        <div class="bigimage"><a href=""><img src="<?php echo $query['image']; ?>" /></a></div>
        <div class="smallimage"><a href=""><img src="<?php echo $query['image']; ?>" /></a></div>
    </div>
    <div class="bigtwo">
        <form method="post" action="listcart.php">
            <input type="hidden" name="name" value="<?php echo $query["name"]; ?>">
                <input type="hidden" name="id" value="<?php echo $query["id"]; ?>">
                <input type="hidden" name="price" value="<?php echo $query["price"]; ?>">
                <input type="hidden" name="image" value="<?php echo $query["image"]; ?>">
        <div class="color"><?php echo $query['name']; ?></div>
        <div class="color">Giá: <?php echo $query['price']; ?> VNĐ</div>
        <div class="color">Thông tin: <div style="color: black"><?php echo $query['info']; ?></div> </div>
        <div class="color">Chọn kích cỡ: <select name="product"><option value="M">M</option><option value="L">L</option><option value="X">X</option><option value="XL">XL</option></select></div>
        <div class="color">Số lượng: <input type="text" value="1" name="txtsl"></input></div>
        <div> <input type="submit" value="Mua ngay" class="regis_button" name="now" /></div>
        </form>
    </div>
    <?php }
           } ?>
</div>
<?php include 'menu_right.php'; ?>
    </div>
<div class="footer">
We are... Mr.Chuot Tru, Mr.Minh Ho
<hr  width="20%" style="margin-left:40%; margin-top:8px;"/>
<pre><br /><br />
Coppyright: Aitieducation
</pre>
</div>
</div>
</body>
</html>